package com.applcn.goods.service;

import com.applcn.goods.repo.entity.GoodsSkuEntity;
import com.applcn.goods.repo.repository.GoodsSkuRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * com.applcn.goods.service
 * Description:
 *
 * @author: 大妖怪
 * @date: 2020-02-22 23:18
 */
@Service
@RequiredArgsConstructor
public class AsyncGoodsSkuService {

    private final GoodsSkuRepository goodsSkuRepository;

    /**
     * 保存sku
     */
    @Async
    @Transactional(rollbackFor = Exception.class)
    public void saveSku(GoodsSkuEntity goodsSkuEntity){
        goodsSkuRepository.save(goodsSkuEntity);
    }
}
